<?php


namespace App\MessageHandler;


use App\Message\Order;
use Psr\Log\LoggerInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

class OrderHandler implements MessageHandlerInterface {
    private $logger;

    public function __construct (LoggerInterface $logger) {
        $this->logger = $logger;
    }

    public function __invoke (Order $order) {
        $this->logger->error('订单ID：'.$order->getOrderId());
    }
}